package com.sh.threadmethod.lambda;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class TestLambda {
    public static void main(String[] args) {

        ILike like = new Like();
        like.lambda();

        // 1、
        ILike iLikeLambda = new ILike() {
            @Override
            public void lambda() {
                System.out.println("I like lambda");
            }
        };

        // 2、
        ILike like1 = () -> {
            System.out.println("I like lambda");
        };
        like1.lambda();

        // 3、
        ILike like2 = () -> System.out.println("I like lambda");
        like2.lambda();

    }
}

interface ILike {
    void lambda();
}

class Like implements ILike {
    @Override
    public void lambda() {
        System.out.println("I like lambda");
    }
}

